package com.danciyixue.boot.client.unit.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.danciyixue.boot.common.result.PageResult;
import com.danciyixue.boot.dcyx.model.query.UnitsQuery;
import com.danciyixue.boot.dcyx.model.vo.UnitsVO;
import com.danciyixue.boot.dcyx.service.UnitsService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 客户端单元控制器
 */
@Tag(name = "09. 单元", description = "单元")
@RestController
@RequestMapping("/api/client/v1/unit")
@RequiredArgsConstructor
public class DcyxUnitController {

    private final UnitsService unitsService;

    /**
     * 获取单元数据
     */
    @GetMapping("/page")
    public PageResult<UnitsVO> page(UnitsQuery queryParams) {
        IPage<UnitsVO> page = unitsService.getUnitsPage(queryParams);
        return PageResult.success(page);
    }
} 